/*
 * @Descripttion:
 * @Author: kcz
 * @Date: 2021-05-02 16:04:02
 * @LastEditors: yubaoshan
 * @LastEditTime: 2022年3月21日 00点28分
 */
// 引入@babel/polyfill处理兼容
// import "@babel/polyfill";
import { createApp } from 'vue'

import App from './App.vue'
import router from './router/'

const app = createApp(App)

import SnowyFormDesign from '../packages/index'
import Cmp from './components/CustomComponent/index.vue'
import 'ant-design-vue/dist/antd.min.css'
// const Cmp = {
//   name: "cmp",
//   render: function(h) {
//     return h("div", "我是自定义组件");
//   }
// };
SnowyFormDesign.setFormDesignConfig({
	title: '测试自定义字段',
	list: [
		{
			type: 'demo', // 表单类型
			label: '自定义组件', // 标题文字
			icon: 'icon-gallery',
			component: Cmp,
			options: {
				defaultValue: undefined,
				multiple: false,
				disabled: false,
				width: '100%',
				clearable: true,
				placeholder: '请选择',
				showSearch: false
			},
			model: '',
			key: '',
			rules: [
				{
					required: false,
					message: '必填项'
				}
			]
		}
	],
	uploadFile: '',
	uploadImage: 'http://localhost:89/dev/file/uploadDynamicReturnUrl',
	uploadFileName: 'file',
	uploadImageName: 'file',
	uploadFileData: { data: 1545 },
	uploadImageData: { data: 1545 },
	uploadFileHeaders: { data: 1545 },
	uploadImageHeaders: { token: '123654' },
	orgTree: [],
	userList: []
})
app.use(SnowyFormDesign)
// SnowyFormDesign.setFormBuildConfig({
//   dynamicData: {
//     test: [
//       { label: "test", value: "1" },
//       { label: "test1", value: "2" }
//     ]
//   }
// });

import Antd, { Modal, message } from 'ant-design-vue'

app.use(Antd)

app.config.globalProperties.$confirm = Modal.confirm
app.config.globalProperties.$message = message

app.use(router)
app.mount('#app')
